package app.r_teenus.backend.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "SERVICE_ACTION")
public class ServiceAction implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5579084056557533962L;
	private Integer id = null;
	private ServiceActionStatusType serviceActionStatusType = null;
	private ServiceType serviceType = null;
	private ServiceDevice serviceDevice = null;
	private ServiceOrder serviceOrder = null;
	private Double amount = null;
	private Double price = null;
	private String description = null;
	private Date created = null;
	private Employee employee = null;
	private Date priceUpdated = null;
	private List<ServiceType> serviceTypeList = new ArrayList<ServiceType>();
	private Integer serviceTypeId = null;

	/**
	 * Gets id (primary key).
	 */
	@Id
	@Column(name = "SERVICE_ACTION")
	@SequenceGenerator(name = "service_action_id", sequenceName = "service_action_id", allocationSize = 1)
	@GeneratedValue(generator = "service_action_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@OneToOne
	@JoinColumn(name = "SERVICE_ACTION_STATUS_TYPE_FK", nullable = false)
	public ServiceActionStatusType getServiceActionStatusType() {
		return serviceActionStatusType;
	}

	public void setServiceActionStatusType(ServiceActionStatusType serviceActionStatusType) {
		this.serviceActionStatusType = serviceActionStatusType;
	}

	@OneToOne
	@JoinColumn(name = "SERVICE_TYPE_FK", nullable = false)
	public ServiceType getServiceType() {
		return serviceType;
	}

	public void setServiceType(ServiceType serviceType) {
		this.serviceType = serviceType;
	}

	@OneToOne
	@JoinColumn(name = "SERVICE_DEVICE_FK", nullable = false)
	public ServiceDevice getServiceDevice() {
		return serviceDevice;
	}

	public void setServiceDevice(ServiceDevice serviceDevice) {
		this.serviceDevice = serviceDevice;
	}

	@OneToOne
	@JoinColumn(name = "SERVICE_ORDER_FK", nullable = false)
	public ServiceOrder getServiceOrder() {
		return serviceOrder;
	}

	public void setServiceOrder(ServiceOrder serviceOrder) {
		this.serviceOrder = serviceOrder;
	}

	@Column(name = "SERVICE_AMOUNT")
	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@Column(name = "ACTION_DESCRIPTION")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

//	@Column(name = "CREATED_BY")
	@Transient
	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	@Column(name = "PRICE_UPDATED")
	public Date getPriceUpdated() {
		return priceUpdated;
	}

	public void setPriceUpdated(Date priceUpdated) {
		this.priceUpdated = priceUpdated;
	}

	@Transient
	public List<ServiceType> getServiceTypeList() {
		return serviceTypeList;
	}

	public void setServiceTypeList(List<ServiceType> serviceTypeList) {
		this.serviceTypeList = serviceTypeList;
	}

	@Transient
	public Integer getServiceTypeId() {
		return serviceTypeId;
	}

	public void setServiceTypeId(Integer serviceTypeId) {
		this.serviceTypeId = serviceTypeId;
	}

}
